import AdminLayout from "@/layout/AdminLayout";
import BaseLayout from "@/layout/BaseLayout";
import {baseLayoutLoader} from "@/layout/BaseLayout/loader.tsx";
import Login from "@/pages/login";
import {adminRoutes} from "@/routes/admin.tsx";
import {frontRoutes} from "@/routes/front.tsx";
import {createBrowserRouter} from "react-router-dom";


const routes = createBrowserRouter([
    {
        path: "/",
        element: <BaseLayout/>,
        loader: baseLayoutLoader,
        children: [
            {
                path: "/login",
                element:<Login/>
            },

            ...frontRoutes,

            {
                path: "/admin",
                element: <AdminLayout/>,
                children: [
                    ...adminRoutes
                ]
            },
        ]
    }
])


export default routes;

